-module(pt_action_string_d004).
-include("pt.hrl").

-export([new/0,from_binary/1,to_binary/1,to_binary/2,get_id/0]).

get_id()-> 16#D004.

new()->#pt_action_string{}.

from_binary(Binary) -> 
	{Binary1,Data1} = lib_protocol:from_binary(Binary,int32),
	{_Binary,Data2} = lib_protocol:from_binary(Binary1,string),
	#pt_action_string{
		action = Data1,
		data = Data2
	}.

to_binary(Pt) -> to_binary(Pt,0).
to_binary(Pt,Seq) -> 
	Data1 = lib_protocol:to_binary(Pt#pt_action_string.action,int32),
	Data2 = lib_protocol:to_binary(Pt#pt_action_string.data,string),
	GetData = <<Data1/binary,Data2/binary>>,
	lib_protocol:make_pt(GetData,get_id(),Seq).

